Show:

Q expandable Class

Implements expandable containers that work on most modern browsers, including ones on touchscreens.

Constructor

Q expandable

(
  • [options]
)
Q.Tool

Parameters:

  • [options] Object optional

    Override various options for this tool

    • [title] String optional

      Required. The title for the expandable.

    • [content] String optional

      Required. The content.

    • [count] Number optional

      A number, if any, to display when collapsed.

    • [spaceAbove] Number optional

      How many pixels of space to leave above at the end of the scrolling animation

    • [expanded] Boolean optional

      Whether it should start out expanded

    • [autoCollapseSiblings] Boolean optional

      Whether, when expanding an expandable, its siblings should be automatically collapsed.

    • [scrollContainer] Boolean optional

      Whether to scroll a parent container when necessary

Returns:

Item Index

Methods

Methods

expand

(
  • [options]
  • [callback]
)

Parameters:

  • [options] Object optional
    • [autoCollapseSiblings] Boolean optional

      Whether, when expanding an expandable,

    • [scrollContainer] Boolean optional

      Whether to scroll a parent container

    • [scrollToElement] Boolean optional

      Can be used to specify another element to scroll to when expanding. Defaults to the title element of the expandable.

    • [spaceAbove] Number optional

      How many pixels of space to leave above at the end of the scrolling animation

  • [callback] Function optional

    the function to call once the expanding has completed